package com.plian.system.controller.sys.per;

import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.per.PerUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 账号-权限
 */
@RestController
@RequestMapping(value = "api/perUser")
public class PerUserController extends BaseController {
    @Autowired
    PerUserService perUserService;
    /**
     * 企业权限配置
     * @param pd
     * @return
     */
    @PostMapping(value = "/userOrgConfig")
    public ObjResult PerUserOrgConfig(@RequestBody PageData pd){
        return perUserService.PerUserOrgConfig(pd);
    }

    /**
     * 企业权限查询
     * @param pd
     * @return
     */
    @PostMapping(value = "/userOrgList")
    public ObjResult PerUserOrgList(@RequestBody PageData pd){
        return perUserService.PerUserOrgList(pd);
    }

//    /**
//     * 根据企业单位码查询权限组
//     * @param pd
//     * @return
//     */
//    @Permissions(url = "perUser/userOrgConfig")
//    @PostMapping(value = "/getGroup")
//    public ListResult getGroup(@RequestBody PageData pd){
//        return perUserService.getGroup(pd);
//    }

    /**
     * 企业权限查询
     * @param pd
     * @return
     */
    @PostMapping(value = "/userConfig")
    public ObjResult PerUserConfig(@RequestBody PageData pd){
        return perUserService.PerUserConfig(pd);
    }
    /**
     * 企业权限查询
     * @param pd
     * @return
     */
    @PostMapping(value = "/userList")
    public ObjResult PerUserList(@RequestBody PageData pd){
        return perUserService.PerUserList(pd);
    }
    @PostMapping(value = "/getBtn")
    public ListResult<PageData> getBtn(@RequestBody PageData pd) throws Exception {
        return perUserService.getBtn(pd);
    }
    @PostMapping(value = "/getUsers")
    public ListResult<PageData> getUsers(@RequestBody PageData pd) throws Exception {
        return perUserService.getUsers(pd);
    }
}
